{% extends "base.html" %}

{% block app_content %}
    <table>
        <tr valign="top">
            <td>
                <h1>{{ user.username }}</h1>
                {% if user.about_me %}<p>{{ user.about_me }}</p>{% endif %}
                {% if user.last_seen %}
                    <p>Last seen on: {{ user.last_seen }}</p>
                {% endif %}
            </td>
        </tr>
    </table>
    <hr>
    {% if user == current_user %}
    <p><a href={{ url_for("edit_profile") }}>Edit your profile</a></p>
    {% elif current_user.is_following(user.id) %}
    <p><a href="{{ url_for('unfollow', username=user.username) }}">UnFollow</a></p>
    {% else %}
    <p><a href="{{ url_for('follow', username=user.username) }}">Follow</a></p>
    {% endif %}
    {% for post in posts %}
    {% include "_post.html" %}
    {% endfor %}
{% endblock %}
